Skip to content

Unified Library sidebar, ⌘K command palette, and keyboard/menu polish - #101

Open
tonkapark wants to merge 14 commits into
Shpigford:mainfrom
tonkapark:feat/sidebar-consolidation
Open

Unified Library sidebar, ⌘K command palette, and keyboard/menu polish#101
tonkapark wants to merge 14 commits into
Shpigford:mainfrom
tonkapark:feat/sidebar-consolidation

Conversation

@tonkapark

Copy link
Copy Markdown

What you get (user-facing)

  • One unified Library sidebar. Skills, Agents, and Rules are now a single Library list instead of three separate sections, plus a Discovery entry that opens the registry browser.
  • ⌘K command palette. Fuzzy-search to jump to any tool's library, browse the registry, or create a skill/agent/rule — fully keyboard-driven (↑/↓ move, ↵ run, ⎋ dismiss).
  • More keyboard shortcuts. ⌘B toggle sidebar, ⌘⇧L go to Library, ⌘, open Settings.
  • Keyboard-friendly Settings. The window opens with its section tabs focused; ←/→ switch between General / Library / AI Assist / Scan Directories / Servers / About.
  • Tidier menus for a single-window app. “New Window” is removed; Close Window (⌘W, with an ✕ icon) now lives in the Window menu next to “Remove Window from Set”.
  • Sturdier registry browse. Trending now shows an explicit “Couldn’t load” + Retry state on failure, enforces its 6-hour cache TTL in memory (not just on disk), and logs scrape parse issues instead of failing silently.

Command palette over the unified Library sidebar

⚠️ Follows #100

This branch is stacked on #100 (Trending browse + local filter for skills registry) and includes its commits. Please review/merge #100 first — once it lands, this PR’s diff collapses to just the sidebar / palette / settings / menu work below. The incremental change over #100 is 16 files, +501/−53.

Code changes (incremental over #100, for reviewers)

  • Command palette — new CommandPaletteView.swift; AppState gains a PaletteAction that runs after the palette sheet dismisses (so two sheets never present at once); ContentView adds the sheet.
  • Sidebar consolidationSidebarView / SkillListView fold all item kinds into “Library”, drop the allAgents/allRules filters, add the Discovery row, and rename the title/empty-state copy. NewSkillSheet always lands new items in Library.
  • Shortcuts & menus (ChopsApp.swift, SkillEditorView.swift) — ⌘B/⌘⇧L/⌘K commands; ⌘B drives SwiftUI columnVisibility via a notification (no AppKit responder hack); New Window removed; Close moved to the Window menu via performClose.
  • Settings nav (SettingsView.swift) — @FocusState + .defaultFocus focus the tab bar on open; ←/→ switch tabs; focus ring suppressed since the selected-tab accent already indicates position.
  • Registry resilience (SkillRegistry.swift, RegistrySheet.swift) — trending cache made static + timestamped with a TTL check; explicit error/Retry UI; scrape parse logging.
  • Docsdocs/feature/sidebar.md, docs/feature/keyboard-navigation.md.

No test suite (per CLAUDE.md); verified by building (LocalRelease) and exercising each path in the running app — ⌘K palette, ⌘B toggle, Settings ←/→, Window-menu Close, and trending load (screenshot above). The sidebar/registry commit also resolves an earlier adversarial code review of the branch.

tonkapark and others added 14 commits May 29, 2026 10:59
Browse Skills opened to a blank placeholder and only the fuzzy
name-search API (e.g. "react" -> 1 result). Scrape skills.sh's
trending page once (~600 skills ranked by installs), cache it in
memory and on disk (6h TTL), and drive an instant local substring
filter — broader and faster than the API, with API hits merged in
for the long tail. Adds an Official-only toggle and badge.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fold Agents/Rules into a unified Skills list showing all item kinds,
drop the Tools section header, and add a Discovery row that opens the
Browse Registry sheet. Remove the now-unused allAgents/allRules filters.

Document the current sidebar in docs/feature/sidebar.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A keyboard-first command palette (⌘K, in the View menu) for quick
actions: jump to any tool's library (or Library/Favorites), open the
Browse Registry sheet, or create a new skill/agent/rule. Fuzzy search,
↑/↓ to move, ↵ to run, ⎋ to dismiss. The chosen action runs after the
palette sheet dismisses so two sheets are never presented at once.

Results are keyed by a stable per-command id (header nested inside each
row) so filtering never shows stale rows, and hover is a separate visual
state that never moves the keyboard selection — keyboard arrows are the
single source of truth.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add View-menu commands: ⌘B toggles the sidebar via the standard
toggleSidebar responder action, and ⌘⇧L selects the Library filter.
Document the ⌘K palette contents and all app keyboard shortcuts in
docs/feature/keyboard-navigation.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…-consolidation

Six validated code-review fixes, no user-facing behavior change vs the
already-documented Unreleased features:

- ⌘B now drives SwiftUI columnVisibility (.all <-> .doubleColumn) via a
  .toggleSidebar notification instead of the AppKit firstResponder
  tryToPerform hack; removes the SwiftUI/AppKit dual source of truth and
  the now-unused AppKit import.
- Trending in-memory cache is now static (survives sheet re-presentations)
  and carries a fetchedAt timestamp with the same 6h TTL check as the disk
  cache, so a long-running session no longer serves indefinitely-stale data.
- parseTrending logs dropped unparseable fragments; fetchTrending logs an
  error when a scrape parses zero skills (markup likely changed).
- RegistrySheet surfaces an explicit "Couldn't load trending" + Retry state
  instead of silently degrading to the generic browse placeholder; search
  stays available.
- Unified Library list title and empty state no longer say "Skills"
  (now "Library" / neutral "No Items"), matching the sidebar and palette.

Verified: build succeeds; ⌘B toggles the sidebar both ways, Library title
renders, ⌘K -> Browse Registry loads Trending, parse logged zero drops.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The Settings window now opens with the section tab bar focused via
@focusstate + .defaultFocus, so ←/→ switch between sections (General,
Library, AI Assist, Scan Directories, Servers, About) without the mouse.
.focusEffectDisabled() suppresses the redundant focus ring — the selected
tab's accent background already indicates position, and the ring otherwise
rendered as a misaligned double box around the selected tab.

⌘, already opened Settings via SwiftUI's native Settings scene (no custom
binding needed); documented it and the new keyboard nav in
docs/feature/keyboard-navigation.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… to Window menu

Chops is a single-window app, so the File menu's "New Window" is removed
(CommandGroup(replacing: .newItem)). Close is no longer a File-menu command:
it now lives in the Window menu as "Close Window" (⌘W), grouped next to the
system "Remove Window from Set" item via CommandGroup(after: .windowSize),
calling NSApp.keyWindow?.performClose(nil). The File menu is now just Save.

Restores `import AppKit` for performClose. The Settings window (and any window)
closes with ⌘W or its close button; closing the main window is recoverable via
the dock icon. Documented in docs/feature/keyboard-navigation.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Use a Label("Close Window", systemImage: "xmark") so the Window-menu Close
command shows an ✕ icon, matching the adjacent "Remove Window from Set" item.
Action and ⌘W shortcut unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…tcuts

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant